<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" lang="zh-CN">
<head th:include="common/common :: bootcss">
    <title>消息推送</title>
    <script>
        $(document).ready(function () {

            $("#btPush").click(function(){
                $.post("/admin/push/send", {
                    msg : $("#msg").val().trim(),
                    userIds : $("#userId").val().trim()
                }, function(data) {
                    if (data.success) {
                        alert("推送成功");
                    } else {
                        alert(data.errorMsg);
                    }
                })
            });
        });

    </script>
</head>
<body>
<ol class="breadcrumb">
    <li><a th:href="@{/admin/push/}">消息推送</a></li>
</ol>
<form id="formCarSearch" class="form" style="padding: 10px">
    <div class="form-group">
        <label for="userId">用户id</label>
        <input type="text" class="form-control" id="userId" placeholder="用户id（选填）">
    </div>
    <div class="form-group">
        <label for="msg">消息</label>
        <textarea class="form-control" id="msg" rows="3" placeholder="消息"></textarea>
    </div>
    <button id="btPush" type="button" class="btn btn-default">推送</button>
</form>

</body>
</html>